<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<lv-card class="policy-card" lvType="{{showOptItems ? 'shadow' : 'border'}}" [lvChecked]="isChecked"
    [ngClass]="{'list-width': showOptItems,'modal-width':!showOptItems}">
    <div class="aui-operation card-operation">
        <h2 class="policy-name" lv-overflow>{{cardItem.name}}</h2>
        <ng-container *ngIf="showOptItems">
            <div (click)="optsClick($event)">
                <ng-container *ngIf="cardItem.create_method !== dataMap.Senesitization_Create_Method.preset.value">
                    <lv-operation-menu lvMenuText="{{'common_operation_label' | i18n}}" [lvData]="cardItem"
                        [lvItemsFn]="optsCallback"></lv-operation-menu>
                </ng-container>
                <ng-container *ngIf="cardItem.create_method === dataMap.Senesitization_Create_Method.preset.value">
                    <span class="aui-link" (click)="create(cardItem, true)" pmpermission
                        pmOperation='CreateDesensitizationPolicy'>{{'common_clone_label' | i18n}}</span>
                </ng-container>
            </div>
        </ng-container>
    </div>
    <div class="aui-operation">
        <div class="objects-container">
            <ng-container *ngIf="!!cardItem.ref_num">
                <p class="aui-link" (click)="getRelNum($event, cardItem)">{{cardItem.ref_num}}</p>
            </ng-container>
            <ng-container *ngIf="!cardItem.ref_num">
                <p>{{cardItem.ref_num}}</p>
            </ng-container>
            <p>{{'common_object_label' | i18n}}</p>
        </div>
        <div class="desc-container">
            <div class="dashed-container">
                <h3>{{'common_desc_label' | i18n}}</h3>
                <div class="description">
                    {{cardItem.description}}
                </div>
            </div>
        </div>
    </div>
</lv-card>